Optimal. Leaf size=170 \[ \frac {2 (a c-b d)^3 \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a^3 \sqrt {a-b} \sqrt {a+b} f}+\frac {d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac {d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac {d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac {d^3 \sec (e+f x) \tan (e+f x)}{2 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 170, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 8, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.320, Rules used = {2907, 3031,
2738, 211, 3855, 3852, 8, 3853} \begin {gather*} \frac {2 (a c-b d)^3 \text {ArcTan}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a^3 f \sqrt {a-b} \sqrt {a+b}}+\frac {d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac {d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac {d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac {d^3 \tan (e+f x) \sec (e+f x)}{2 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 211
Rule 2738
Rule 2907
Rule 3031
Rule 3852
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {(c+d \sec (e+f x))^3}{a+b \cos (e+f x)} \, dx &=\int \frac {(d+c \cos (e+f x))^3 \sec ^3(e+f x)}{a+b \cos (e+f x)} \, dx\\ &=\int \left (\frac {(a c-b d)^3}{a^3 (a+b \cos (e+f x))}+\frac {d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \sec (e+f x)}{a^3}+\frac {d^2 (3 a c-b d) \sec ^2(e+f x)}{a^2}+\frac {d^3 \sec ^3(e+f x)}{a}\right ) \, dx\\ &=\frac {d^3 \int \sec ^3(e+f x) \, dx}{a}+\frac {(a c-b d)^3 \int \frac {1}{a+b \cos (e+f x)} \, dx}{a^3}+\frac {\left (d^2 (3 a c-b d)\right ) \int \sec ^2(e+f x) \, dx}{a^2}+\frac {\left (d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right )\right ) \int \sec (e+f x) \, dx}{a^3}\\ &=\frac {d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac {d^3 \sec (e+f x) \tan (e+f x)}{2 a f}+\frac {d^3 \int \sec (e+f x) \, dx}{2 a}+\frac {\left (2 (a c-b d)^3\right ) \text {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{a^3 f}-\frac {\left (d^2 (3 a c-b d)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{a^2 f}\\ &=\frac {2 (a c-b d)^3 \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{a^3 \sqrt {a-b} \sqrt {a+b} f}+\frac {d^3 \tanh ^{-1}(\sin (e+f x))}{2 a f}+\frac {d \left (3 a^2 c^2-3 a b c d+b^2 d^2\right ) \tanh ^{-1}(\sin (e+f x))}{a^3 f}+\frac {d^2 (3 a c-b d) \tan (e+f x)}{a^2 f}+\frac {d^3 \sec (e+f x) \tan (e+f x)}{2 a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.38, size = 335, normalized size = 1.97 \begin {gather*} \frac {-\frac {8 (a c-b d)^3 \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}-2 d \left (-6 a b c d+2 b^2 d^2+a^2 \left (6 c^2+d^2\right )\right ) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )+2 d \left (-6 a b c d+2 b^2 d^2+a^2 \left (6 c^2+d^2\right )\right ) \log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )+\frac {a^2 d^3}{\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )^2}+\frac {4 a d^2 (3 a c-b d) \sin \left (\frac {1}{2} (e+f x)\right )}{\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )}-\frac {a^2 d^3}{\left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )^2}+\frac {4 a d^2 (3 a c-b d) \sin \left (\frac {1}{2} (e+f x)\right )}{\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )}}{4 a^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.44, size = 291, normalized size = 1.71
method | result | size |
derivativedivides | \(\frac {\frac {2 \left (c^{3} a^{3}-3 a^{2} b \,c^{2} d +3 a \,b^{2} c \,d^{2}-b^{3} d^{3}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {d^{3}}{2 a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {d \left (6 a^{2} c^{2}+d^{2} a^{2}-6 c d a b +2 b^{2} d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2 a^{3}}-\frac {d^{2} \left (6 a c -d a -2 b d \right )}{2 a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}-\frac {d^{3}}{2 a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {d \left (6 a^{2} c^{2}+d^{2} a^{2}-6 c d a b +2 b^{2} d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2 a^{3}}-\frac {d^{2} \left (6 a c -d a -2 b d \right )}{2 a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}}{f}\) | \(291\) |
default | \(\frac {\frac {2 \left (c^{3} a^{3}-3 a^{2} b \,c^{2} d +3 a \,b^{2} c \,d^{2}-b^{3} d^{3}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{3} \sqrt {\left (a -b \right ) \left (a +b \right )}}+\frac {d^{3}}{2 a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )^{2}}-\frac {d \left (6 a^{2} c^{2}+d^{2} a^{2}-6 c d a b +2 b^{2} d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2 a^{3}}-\frac {d^{2} \left (6 a c -d a -2 b d \right )}{2 a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}-\frac {d^{3}}{2 a \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )^{2}}+\frac {d \left (6 a^{2} c^{2}+d^{2} a^{2}-6 c d a b +2 b^{2} d^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2 a^{3}}-\frac {d^{2} \left (6 a c -d a -2 b d \right )}{2 a^{2} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}}{f}\) | \(291\) |
risch | \(-\frac {i d^{2} \left (a d \,{\mathrm e}^{3 i \left (f x +e \right )}-6 a c \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b d \,{\mathrm e}^{2 i \left (f x +e \right )}-d \,{\mathrm e}^{i \left (f x +e \right )} a -6 a c +2 b d \right )}{a^{2} f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}+\frac {3 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c^{2}}{a f}+\frac {d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{2 a f}-\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c b}{a^{2} f}+\frac {d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) b^{2}}{a^{3} f}-\frac {3 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c^{2}}{a f}-\frac {d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{2 a f}+\frac {3 d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c b}{a^{2} f}-\frac {d^{3} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) b^{2}}{a^{3} f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) c^{3}}{\sqrt {-a^{2}+b^{2}}\, f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) b \,c^{2} d}{\sqrt {-a^{2}+b^{2}}\, f a}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) b^{2} c \,d^{2}}{\sqrt {-a^{2}+b^{2}}\, f \,a^{2}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) b^{3} d^{3}}{\sqrt {-a^{2}+b^{2}}\, f \,a^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) c^{3}}{\sqrt {-a^{2}+b^{2}}\, f}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b \,c^{2} d}{\sqrt {-a^{2}+b^{2}}\, f a}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b^{2} c \,d^{2}}{\sqrt {-a^{2}+b^{2}}\, f \,a^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+a \sqrt {-a^{2}+b^{2}}}{\sqrt {-a^{2}+b^{2}}\, b}\right ) b^{3} d^{3}}{\sqrt {-a^{2}+b^{2}}\, f \,a^{3}}\) | \(892\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 349 vs.
\(2 (163) = 326\).
time = 23.12, size = 771, normalized size = 4.54 \begin {gather*} \left [\frac {2 \, {\left (a^{3} c^{3} - 3 \, a^{2} b c^{2} d + 3 \, a b^{2} c d^{2} - b^{3} d^{3}\right )} \sqrt {-a^{2} + b^{2}} \cos \left (f x + e\right )^{2} \log \left (\frac {2 \, a b \cos \left (f x + e\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (f x + e\right ) + b\right )} \sin \left (f x + e\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + a^{2}}\right ) + {\left (6 \, {\left (a^{4} - a^{2} b^{2}\right )} c^{2} d - 6 \, {\left (a^{3} b - a b^{3}\right )} c d^{2} + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (6 \, {\left (a^{4} - a^{2} b^{2}\right )} c^{2} d - 6 \, {\left (a^{3} b - a b^{3}\right )} c d^{2} + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} d^{3} + 2 \, {\left (3 \, {\left (a^{4} - a^{2} b^{2}\right )} c d^{2} - {\left (a^{3} b - a b^{3}\right )} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, {\left (a^{5} - a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2}}, \frac {4 \, {\left (a^{3} c^{3} - 3 \, a^{2} b c^{2} d + 3 \, a b^{2} c d^{2} - b^{3} d^{3}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (f x + e\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (f x + e\right )}\right ) \cos \left (f x + e\right )^{2} + {\left (6 \, {\left (a^{4} - a^{2} b^{2}\right )} c^{2} d - 6 \, {\left (a^{3} b - a b^{3}\right )} c d^{2} + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left (6 \, {\left (a^{4} - a^{2} b^{2}\right )} c^{2} d - 6 \, {\left (a^{3} b - a b^{3}\right )} c d^{2} + {\left (a^{4} + a^{2} b^{2} - 2 \, b^{4}\right )} d^{3}\right )} \cos \left (f x + e\right )^{2} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left ({\left (a^{4} - a^{2} b^{2}\right )} d^{3} + 2 \, {\left (3 \, {\left (a^{4} - a^{2} b^{2}\right )} c d^{2} - {\left (a^{3} b - a b^{3}\right )} d^{3}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{4 \, {\left (a^{5} - a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (c + d \sec {\left (e + f x \right )}\right )^{3}}{a + b \cos {\left (e + f x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 352 vs.
\(2 (163) = 326\).
time = 0.55, size = 352, normalized size = 2.07 \begin {gather*} \frac {\frac {{\left (6 \, a^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} + 2 \, b^{2} d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a^{3}} - \frac {{\left (6 \, a^{2} c^{2} d - 6 \, a b c d^{2} + a^{2} d^{3} + 2 \, b^{2} d^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a^{3}} - \frac {4 \, {\left (a^{3} c^{3} - 3 \, a^{2} b c^{2} d + 3 \, a b^{2} c d^{2} - b^{3} d^{3}\right )} {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{3}} - \frac {2 \, {\left (6 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 2 \, b d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 6 \, a c d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \, b d^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{2} a^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.93, size = 2500, normalized size = 14.71 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________